package com.shoppingmall.dao;

import com.shoppingmall.pojo.Product;
import com.shoppingmall.vo.ProductDetailVo;
import com.shoppingmall.vo.ProductListVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ProductMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Product record);

    int insertSelective(Product record);

    Product selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Product record);

    int updateByPrimaryKey(Product record);

    List<ProductListVo> selectAllProduct();

    List<ProductListVo> selectProductByProductNameOrProductId(@Param("productName") String productName, @Param("productId")Integer productId);

    ProductDetailVo selectProductDetailByProductId(Integer productId);

    List<ProductListVo> selectStatusProduct(@Param("categoryIdList") List<Integer> categoryIdList, @Param("keyword") String keyword);

    ProductDetailVo selectUserProductDetail(Integer productId);

    Integer selectCountProduct();
}